home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / mesa / mesa-tk / make-config.amigaos next >
Text File  |  2000-02-23  |  9KB  |  325 lines

  1. # Make-config
  2.  
  3. MAJOR=3
  4. MINOR=1
  5. VERSION=$(MAJOR).$(MINOR)
  6.  
  7. .PHONY:    amigaos% targets default clean realclean exec dep %AmigaOS
  8.  
  9. ## specify $(SRCS)
  10.  
  11. OBJ0 = $(SRCS:.S=$(O))
  12. OBJ1 = $(OBJ0:.c=$(O))
  13. OBJ2 = $(OBJ1:.cc=$(O))
  14. OBJ3 = $(OBJ2:.c++=$(O))
  15. OBJ4 = $(OBJ3:.C=$(O))
  16. OBJS = $(OBJ4:.cpp=$(O))
  17.  
  18. ## global gcc-flags
  19.  
  20. WARN = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
  21. PROC = -m68030 -m68881
  22. OPTI = -O2
  23. MORE = #-fgcse -fregmove -fno-float-store -fno-function-cse -fpeephole    \
  24.     #-ffast-math -fomit-frame-pointer -fstrength-reduce        \
  25.     #-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns    \
  26.     #-fschedule-insns2 -fmove-all-movables -freg-struct-return    \
  27.     #-freduce-all-givs -fexpensive-optimizations -mbitfield
  28.  
  29. ## specify $(LIB_DIR)/$(LIB_DEP)
  30.  
  31. LIB_LINK = -L$(LIB_DIR) $(subst .a.static,,$(subst $(LIB_DIR)/lib,-l,$(LIB_DEP)))
  32.  
  33. ##### TARGETS #####
  34. ## specify $(DIRS)/$(MAKEFILE)
  35.  
  36. default:
  37.     @echo "Specify a target configuration"
  38.  
  39. clean:
  40.     -rm $(OBJS) *~
  41.     @for dirs in $(DIRS) -dmmy-; do            \
  42.       if [ -d $$dirs ]; then            \
  43.         (cd $$dirs;                    \
  44.          $(MAKE) -f $(MAKEFILE) $@ -$(MAKEFLAGS) );    \
  45.       else true; fi;                \
  46.     done
  47.  
  48. realclean: clean
  49.     -rm $(PRGS)
  50.     @for dirs in $(DIRS) -dmmy-; do            \
  51.       if [ -d $$dirs ]; then            \
  52.         (cd $$dirs;                    \
  53.          $(MAKE) -f $(MAKEFILE) $@ -$(MAKEFLAGS) );    \
  54.       else true; fi;                \
  55.     done
  56.  
  57. ## build recursive targets
  58. ## specify $(DIRS)
  59. targets: $(LIB_DEP) $(PRGS)
  60.     @for dirs in $(DIRS) -dmmy-; do            \
  61.       if [ -d $$dirs ]; then            \
  62.         (cd $$dirs;                    \
  63.          $(MAKE) -f $(MAKEFILE) $@ -$(MAKEFLAGS) );    \
  64.       else true; fi;                \
  65.     done
  66.  
  67. ## execute all programs
  68. ## specify $(PRGS)
  69. exec: $(PRGS)
  70.     @for prgs in $(PRGS) -dmmy-; do            \
  71.       if [ -f $$prgs ]; then            \
  72.         (echo -n "Running $$prgs ..." ;        \
  73.          echo $$prgs ;                \
  74.          echo ) ;                    \
  75.       else true; fi;                \
  76.     done
  77.  
  78. ## specify $(SRCS)/$(CFLAGS)
  79. dep: $(SRCS)
  80.     @makedepend -fdepend -Y -I$(INC_DIR) -I. -- $(CFLAGS) -- $^
  81.     @for dirs in $(DIRS) -dmmy-; do            \
  82.       if [ -d $$dirs ]; then            \
  83.         (cd $$dirs;                    \
  84.          $(MAKE) -f $(MAKEFILE) $@ -$(MAKEFLAGS) );    \
  85.       else true; fi;                \
  86.     done
  87.  
  88. ## all unknown targets
  89. ## specify $(DIRS)
  90. #%:
  91. #    @for dirs in $(DIRS) -dmmy-; do            \
  92. #      if [ -d $$dirs ]; then            \
  93. #        (cd $$dirs;                    \
  94. #         $(MAKE) -f $(MAKEFILE) $@ -$(MAKEFLAGS) );    \
  95. #      else true; fi;                \
  96. #    done
  97.  
  98. ##### RULES #####
  99.  
  100. .SUFFIXES:
  101. .SUFFIXES: .c .cc .cpp .h $(O) .l .y .c++
  102.  
  103. ## shared
  104. #%.o: %.c
  105. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) -resident32 -malways-restore-a4 $< -o $@
  106. #%.o: %.cc
  107. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) -resident32 -malways-restore-a4 $< -o $@
  108. #%.o: %.cpp
  109. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) -resident32 -malways-restore-a4 $< -o $@
  110. ## static
  111. #%_s.o: %.c
  112. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  113. #%_s.o: %.cc
  114. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  115. #%_s.o: %.cpp
  116. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  117. ## profiled
  118. #%_p.o: %.c
  119. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  120. #%_p.o: %.cc
  121. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  122. #%_p.o: %.cpp
  123. #    $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
  124. #
  125. ## simple executables
  126. ## specify $(LIB_DEP)
  127.  
  128. PRG_DEP = $(LIB_DEP)
  129. #PRG_DEP = 
  130.  
  131. ## dependency
  132. depend: $(SRCS)
  133.     touch depend
  134.  
  135. ## dependency import
  136. include depend
  137.  
  138. # Mesa 3-D graphics library
  139. # Copyright (C) 1995-1998  Brian Paul
  140. #
  141. # This library is free software; you can redistribute it and/or
  142. # modify it under the terms of the GNU Library General Public
  143. # License as published by the Free Software Foundation; either
  144. # version 2 of the License, or (at your option) any later version.
  145. #
  146. # This library is distributed in the hope that it will be useful,
  147. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  148. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  149. # Library General Public License for more details.
  150. #
  151. # You should have received a copy of the GNU Library General Public
  152. # License along with this library; if not, write to the Free
  153. # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  154.  
  155. # The following variables are passed to each Makefile:
  156. #
  157. # GL_LIB      the name of the Mesa "GL" library file (usually libMesaGL.a)
  158. # GLU_LIB     the name of the Mesa "GLU" library file (usually libMesaGLU.a)
  159. # GLUT_LIB    the name of the GLUT library file (usually libglut.a)
  160. # CC          the C compiler (usually cc or gcc)
  161. # CFLAGS      flags to C compiler (usually -O)
  162. # MAKELIB     the script or command to make a library file
  163. # XLIBS       libraries needed to link X apps (at least -lX11)
  164. #
  165. # Optionally, you can add definitions for the INCDIR and LIBDIR variables
  166. # which specify where to find the Mesa include files and where to put the
  167. # Mesa libraries.  The defaults are ../include and ../lib.  This use of
  168. # overriding makefile macros on the command line should work with most
  169. # variants of make.
  170. #
  171. # To enable profiling add -DPROFILE to the CFLAGS line.  Be sure to set the
  172. # MESA_PROFILE environment variable to enable printing of the profile report.
  173. #
  174. # If your system supports the X Shared Memory extension add -DSHM to the
  175. # CFLAGS line and add -lXext to the XLIBS line.
  176. #
  177. # Some compilers complain about const parameters.  Adding -DNO_CONST to the
  178. # CFLAGS line should silence suth warnings.
  179. #
  180. #
  181. # To add a new system configuration just follow the examples below and update
  182. # the top-level Makefile.
  183.  
  184. amigaos:
  185.     $(MAKE) -f Makefile.AmigaOS targets        \
  186.     "GL_LIB = libMesaGL.a"                \
  187.     "GLU_LIB = libMesaGLu.a"            \
  188.     "GLUT_LIB = libMesaGLut.a"            \
  189.     "GLSMAP_LIB = libMesaGLsmap.a"            \
  190.     "GLE_LIB = libMesaGLe.a"            \
  191.     "GLEEM_LIB = libMesaGLeem.a"            \
  192.     "GLMUI_LIB = libMesaGLmui.a"            \
  193.     "GLUI_LIB = libMesaGLui.a"            \
  194.     "GLTT_LIB = libMesaGLtt.a"            \
  195.     "TK_LIB = libMesaGLtk.a"            \
  196.     "AUX_LIB = libMesaGLaux.a"            \
  197.     "APP_LIB = libMesaGLapprentice.a"        \
  198.     "DXF_LIB = libdxf.a"                \
  199.     "CC = gcc"                    \
  200.     "CXX = g++"                    \
  201.     "CFLAGS = $(OPTI) $(PROC) $(WARN) $(MORE)"    \
  202.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS"        \
  203.     "MAKEFILE = Makefile.AmigaOS"            \
  204.     "XLIBS = -lamiga"                \
  205.     "O = .o"                    \
  206.     -$(MAKEFLAGS)
  207.  
  208. amigaos-fast:
  209.     $(MAKE) -f Makefile.AmigaOS targets        \
  210.     "GL_LIB = libMesaGL_f.a"            \
  211.     "GLU_LIB = libMesaGLu_f.a"            \
  212.     "GLUT_LIB = libMesaGLut_f.a"            \
  213.     "GLSMAP_LIB = libMesaGLsmap_f.a"        \
  214.     "GLE_LIB = libMesaGLe_f.a"            \
  215.     "GLEEM_LIB = libMesaGLeem_f.a"            \
  216.     "GLMUI_LIB = libMesaGLmui_f.a"            \
  217.     "GLUI_LIB = libMesaGLui_f.a"            \
  218.     "GLTT_LIB = libMesaGLtt_f.a"            \
  219.     "TK_LIB = libMesaGLtk_f.a"            \
  220.     "AUX_LIB = libMesaGLaux_f.a"            \
  221.     "APP_LIB = libMesaGLapprentice.a"        \
  222.     "DXF_LIB = libdxf.a"                \
  223.     "CC = gcc"                    \
  224.     "CXX = g++"                    \
  225.     "CFLAGS = $(OPTI) $(PROC) $(WARN) $(MORE)"    \
  226.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS"        \
  227.     "MAKEFILE = Makefile.AmigaOS"            \
  228.     "XLIBS = -lamiga"                \
  229.     "O = _f.o"                    \
  230.     -$(MAKEFLAGS)
  231.  
  232. amigaos-depend:
  233.     $(MAKE) -f Makefile.AmigaOS dep            \
  234.     "GL_LIB = libMesaGL.a"                \
  235.     "GLU_LIB = libMesaGLu.a"            \
  236.     "GLUT_LIB = libMesaGLut.a"            \
  237.     "GLSMAP_LIB = libMesaGLsmap.a"            \
  238.     "GLE_LIB = libMesaGLe.a"            \
  239.     "GLEEM_LIB = libMesaGLeem.a"            \
  240.     "GLMUI_LIB = libMesaGLmui.a"            \
  241.     "GLUI_LIB = libMesaGLui.a"            \
  242.     "GLTT_LIB = libMesaGLtt.a"            \
  243.     "TK_LIB = libMesaGLtk.a"            \
  244.     "AUX_LIB = libMesaGLaux.a"            \
  245.     "APP_LIB = libMesaGLapprentice.a"        \
  246.     "DXF_LIB = libdxf.a"                \
  247.     "CC = gcc"                    \
  248.     "CXX = g++"                    \
  249.     "CFLAGS = -Damigaos -DAMIGA -DTRYTEST"         \
  250.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS"        \
  251.     "MAKEFILE = Makefile.AmigaOS"            \
  252.     "XLIBS = -lamiga"                \
  253.     "O = .o"                    \
  254.     -$(MAKEFLAGS)
  255.  
  256. amigaos-lclint:
  257.     $(MAKE) -ki -f Makefile.AmigaOS targets        \
  258.     "GL_LIB = libMesaGL.a"                \
  259.     "GLU_LIB = libMesaGLu.a"            \
  260.     "GLUT_LIB = libMesaGLut.a"            \
  261.     "GLSMAP_LIB = libMesaGLsmap.a"            \
  262.     "GLE_LIB = libMesaGLe.a"            \
  263.     "GLEEM_LIB = libMesaGLeem.a"            \
  264.     "GLMUI_LIB = libMesaGLmui.a"            \
  265.     "GLUI_LIB = libMesaGLui.a"            \
  266.     "GLTT_LIB = libMesaGLtt.a"            \
  267.     "TK_LIB = libMesaGLtk.a"            \
  268.     "AUX_LIB = libMesaGLaux.a"            \
  269.     "APP_LIB = libMesaGLapprentice.a"        \
  270.     "DXF_LIB = libdxf.a"                \
  271.     "CC = lclint"                    \
  272.     "CXX = lclint"                    \
  273.     "CFLAGS = -I/INCC"                \
  274.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS-lclint"    \
  275.     "MAKEFILE = Makefile.AmigaOS"            \
  276.     "XLIBS = -lamiga"                \
  277.     "O = .o"                    \
  278.     -$(MAKEFLAGS)
  279.  
  280. amigaos-static:
  281.     $(MAKE) -f Makefile.AmigaOS targets        \
  282.     "GL_LIB = libMesaGL.a"                \
  283.     "GLE_LIB = libMesaGLe.a"            \
  284.     "GLEEM_LIB = libMesaGLeem.a"            \
  285.     "GLMUI_LIB = libMesaGLmui.a"            \
  286.     "GLSMAP_LIB = libMesaGLsmap.a"            \
  287.     "GLU_LIB = libMesaGLu.a"            \
  288.     "GLUI_LIB = libMesaGLui.a"            \
  289.     "GLUT_LIB = libMesaGLut.a"            \
  290.     "GLTT_LIB = libMesaGLtt.a"            \
  291.     "APP_LIB = libMesaGLapprentice.a"        \
  292.     "TK_LIB = libMesaGLtk.a"            \
  293.     "AUX_LIB = libMesaGLaux.a"            \
  294.     "DXF_LIB = libdxf.a"                \
  295.     "CC = gcc"                    \
  296.     "CXX = g++"                    \
  297.     "CFLAGS = $(OPTI) $(PROC) $(WARN) $(MORE)"    \
  298.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS"        \
  299.     "MAKEFILE = Makefile.AmigaOS"            \
  300.     "XLIBS = -lamiga"                \
  301.     "O = _s.o"                    \
  302.     -$(MAKEFLAGS)
  303.  
  304. amigaos-prof:
  305.     $(MAKE) -f Makefile.AmigaOS targets        \
  306.     "GL_LIB = libMesaGL_p.a"            \
  307.     "GLU_LIB = libMesaGLu_p.a"            \
  308.     "GLUT_LIB = libMesaGLut_p.a"            \
  309.     "GLSMAP_LIB = libMesaGLsmap_p.a"        \
  310.     "GLE_LIB = libMesaGLe_p.a"            \
  311.     "GLMUI_LIB = libMesaGLmui_p.a"            \
  312.     "GLUI_LIB = libMesaGLui_p.a"            \
  313.     "TK_LIB = libMesaGLtk_p.a"            \
  314.     "AUX_LIB = libMesaGLaux_p.a"            \
  315.     "APP_LIB = libMesaGLapprentice.a"        \
  316.     "DXF_LIB = libdxf.a"                \
  317.     "CC = gcc"                    \
  318.     "CXX = g++"                    \
  319.     "CFLAGS = -pg $(PROC) $(WARN) -DPROFILE"    \
  320.     "MAKELIB = $(ROOT)/bin/mklib.AmigaOS-prof"    \
  321.     "MAKEFILE = Makefile.AmigaOS"            \
  322.     "XLIBS = -lamiga"                \
  323.     "O = _p.o"                    \
  324.     -$(MAKEFLAGS)
  325.